<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display-el" %>
<html>
<head>
    <link href="<s:url value='../css/style.css'/>" rel="stylesheet" type="text/css"/>
    <style>
		body {	
			background-color: #e8eefa;
			font-family: Verdana;	
			font-size: 11px;	
			line-height: 1em;	
			color: #000000;
		}
    	td {
    		white-space:nowrap;
    	}
    </style>
    <title></title>
   	<s:head theme="ajax"/>
</head>

<script language="javascript" type="text/javascript">
function deletaCategoria(url){
	if (confirm('Você confirma a exclusão da categoria?')) {
		document.location.href = url;
	}
}
function novaCategoria(){
	<s:url id="url" action="crudCat_input" />
	document.location.href = "<s:property value="#url"/>";
}
</script>

<body>

<center>
<s:form theme="simple" action="crudCat_save" name="categoria" method="post">
<table width="400" cellpadding="0" cellspacing="0" border="0">
<tr>
	<td width="15" height="16" align="right"><img src="../images/box-form-top-left.gif"></td>
	<td height="16" align="right" background="../images/box-form-up.gif" style="background-repeat: repeat-x"></td>
	<td width="15" height="16" align="left"><img src="../images/box-form-top-right.gif"></td>
</tr>
<tr>
	<td width="15" align="right" background="../images/box-form-middle-left.gif" style="background-repeat: repeat-y"></td>
	<td style="background-color: #f6f8f7;" align="center">
		<table width="100%" cellpadding="1" cellspacing="0" border="0">
		<tr>
			<td colspan="2"><img src="../images/titulo-form-cadastro-categorias.gif"></td>
		</tr>
		<tr>
			<td align="center"><br />
				<table width="70%" class="borderAll" cellpadding="2" cellspacing="0" border="0">
		    	<tr>
			    	<td align="center">
				    	<display-el:table name="categorias" htmlId="categorias-report" id="cat" class="report-table" requestURI="/ProjInner/categoria/consultaCat.action" pagesize="20" sort="list" cellspacing="0">
				    		<s:set name="myrow" value="#attr.cat"/>
				    		<display-el:column style="width: 330px;" class="column-cdcategoria" headerClass="column-cdcategoria" property="cdCategoria" title="cdCategoria" sortable="true" />
				    		<display-el:column style="width: 330px;" class="column-categoria" headerClass="column-categoria" property="nmCategoria" title="Categoria" sortable="true" />
				    		<display-el:column style="width: 70px;" class="column-status" headerClass="column-status" property="statusCategoria" title="Status" sortable="true" />
				    		<display-el:column class="column-editar" headerClass="column-editar" >
				    			<s:url action="crudCat_edit" id="url">
				                    <s:param name="categoria.cdCategoria" value="%{#myrow.cdCategoria}"/>
				                </s:url>
				                <a href="<s:property value="#url"/>"><img src="../images/icone-editar.gif" style="cursor: pointer;" border="0" /></a>
				    		</display-el:column>
				    		<display-el:column class="column-deletar" headerClass="column-deletar">
				    			<s:url action="crudCat_delete" id="url">
				                    <s:param name="categoria.cdCategoria" value="%{#myrow.cdCategoria}"/>
				                </s:url>
				                <a href="#" onclick="deletaCategoria('<s:property value="#url"/>')"><img src="../images/icone-deletar.gif" style="cursor: pointer;" border="0" /></a>
				    		</display-el:column>
				    	</display-el:table>
			    	</td>
		    	</tr>
			    </table>
   			</td>
		</tr>
		<tr>
			<td colspan="2" align="center"><br />
			    <!-- BOTÕES -->
			    <table width="160" cellpadding="3" cellspacing="0" border="0">
			    <tr>
			    	<td colspan="2" align="center"><img src="../images/button-separator.gif" style="cursor: pointer;" /></td>
			    </tr>
			    <tr>
			    	<td width="80" align="center"><img src="../images/botao-nova.gif" style="cursor: pointer;" onclick="novaCategoria();" border="0"/></td>
			    	<td width="80" align="center"><a href="../../principal.jsp"><img src="../images/botao-voltar.gif" style="cursor: pointer;" border="0" /></a></td>
			    </tr>
			    </table>
			</td>
		</tr>
		</table>
	</td>
	<td width="15" align="left" background="../images/box-form-middle-right.gif" style="background-repeat: repeat-y"></td>
</tr>
<tr>
	<td width="15" height="16" align="right"><img src="../images/box-form-bottom-left.gif"></td>
	<td height="16" align="left" background="../images/box-form-bottom.gif" style="background-repeat: repeat-x"></td>
	<td width="15" height="16" align="left"><img src="../images/box-form-bottom-right.gif"></td>
</tr>
</table>

</s:form>
</center>
</body>
</html>